#ifndef FOODMENU_H
#define FOODMENU_H

#include <QWidget>
#include "foodcustom.h"
#include <QFrame>
#include <QToolButton>
#include <QLabel>
#include <QLineEdit>
#include <QHBoxLayout>
#include <QSpacerItem>
#include <QVBoxLayout>
#include <QPixmap>
#include <QDebug>
#include <QVector>
#include <QString>
#include <QByteArray>
class closeinfo
{
public:
    closeinfo(QString name = "",QString money = "",QString number = ""):name(name),money(money),number(number){}
    QString name;
    QString money;
    QString number;

    friend bool operator ==(const closeinfo &c1,const closeinfo &c2)
    {
        QByteArray name1 =  c1.name.toLatin1();
        char* sendname1 = name1.data();
        QByteArray name2 =  c2.name.toLatin1();
        char* sendname2 = name2.data();
         return strcmp(sendname1,sendname2) == 0?true:false;
    }
};

class FoodFrame : public QFrame{
    Q_OBJECT
public:
    FoodFrame(QString FoodName = "", QString FoodMoney = "",QWidget *parent = nullptr);
    QFrame *Infoframe;
    QLabel *foodNameLabel;
    QLabel *foodMoneyLabel;
    QToolButton *addButton;
    QToolButton *delButton;
    QLineEdit *NumLineEdit;
    QHBoxLayout *infoHlayout;

signals:
    void sendCloseInfo(QVector<closeinfo> &closinfo);
    void sendEditText(const QString & caiName);
};

namespace Ui {
class FoodMenu;
}

class FoodMenu : public QWidget
{
    Q_OBJECT

public:
    explicit FoodMenu(QWidget *parent = 0);
    ~FoodMenu();

    QWidget * receiptWindow;
    QLabel *logolabel;

    void initwindow();
    void setTabelNum(QString tabelNumber,QString eaternumber);

    QSpacerItem *spacer;

private slots:
    void on_pushButton_2_clicked();

    void on_BillingButton_clicked();

    void on_toolButton_4_clicked();

    void on_toolButton_3_clicked();

private:
    Ui::FoodMenu *ui;
signals:
    void sendBackSign();
    void closinfo(QVector<closeinfo> &closinfo);

};



class ReceiptWindow : public QWidget{
    Q_OBJECT
public:
    ReceiptWindow(QWidget *parent = nullptr);

signals:

};

#endif // FOODMENU_H
